Changes for the 2025 draft CCS spec#3041
Open
nickygerritsen wants to merge 4 commits intoDOMjudge:mainfrom
Open
Changes for the 2025 draft CCS spec#3041nickygerritsen wants to merge 4 commits intoDOMjudge:mainfrom
nickygerritsen wants to merge 4 commits intoDOMjudge:mainfrom
Conversation
7690dcd to
6ef7947
Compare
6ef7947 to
ab7cad5
Compare
ab7cad5 to
d56568c
Compare
d56568c to
bc3b3b0
Compare
meisterT
reviewed
Dec 1, 2025
| if ($this->dj->checkrole('team') && $this->dj->getUser()->getTeam()) { | ||
| $capabilities[] = 'team_submit'; | ||
| $capabilities[] = 'team_clar'; | ||
| if ($ccsApiVersion->usePostClar()) { |
Member
There was a problem hiding this comment.
What does usePostClar mean? Can we change it to a descriptive name?
| public function __construct( | ||
| #[Serializer\Inline] | ||
| protected readonly ContestProblem $contestProblem, | ||
| #[Serializer\Groups([ARC::GROUP_NONSTRICT, '2025-draft'])] |
Member
Author
There was a problem hiding this comment.
It only exposes it for those serializer groups. Non strict means 'expose it unless you do ?strict=1' and the draft group means: 'only expose it for this draft version'.
I will change the draft version to a constant though.
| return $this->valid; | ||
| } | ||
|
|
||
| // Note: we can't use CCSApiVersion::Format_2025_DRAFT->value in PHP 8.1, only in 8.2+ |
Member
There was a problem hiding this comment.
We just set the min PHP version to 8.2+
Member
Author
There was a problem hiding this comment.
We did not yet on git, but indeed we can once we merge that PR. I will wait before merging this so I can change it.
| /** @var CcsApiVersion $ccsApiVersion */ | ||
| $ccsApiVersion = $this->config->get('ccs_api_version'); | ||
| if ($ccsApiVersion->useRelTimes()) { | ||
| $contest->setPenaltyTimeForApi(Utils::relTime((int)$penaltyTime * 60, true)); |
| $penaltyTime = $event['penalty_time']; | ||
| $penaltyTimeIsRelative = is_string($penaltyTime) && Utils::isRelTime($penaltyTime); | ||
| if ($ccsApiVersion->useRelTimes() && !$penaltyTimeIsRelative) { | ||
| $event['penalty_time'] = Utils::relTime($penaltyTime * 60, true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the new fields in the new API spec, as well as change some
intfields toreltimewhen using that version.The biggest missing thing currently are things that are still WIP in the spec:
Fixes #2946